import request from '@/router/axios';
import { baseUrl } from '@/config/env';

export const getById = (id) => request({
    url: baseUrl + '/admin/resources/detail/' + id,
    method: 'get',
});

export const listResources = () => request({
    url: baseUrl + '/admin/resources/listResources',
    method: 'get',
});

export const roleResources = (id) => request({
    url: baseUrl + '/admin/resources/listResources/' + id,
    method: 'get',
});

export const saveResources = (data) => request({
    url: baseUrl + '/admin/resources/save',
    method: 'post',
    data: data
});

export const updateResources = (data) => request({
    url: baseUrl + '/admin/resources/update',
    method: 'put',
    data: data
});

export const deleteResources = (id) => request({
    url: baseUrl + '/admin/resources/delete/'+id,
    method: 'delete',
});
